1 //------------------------------------------------------------------------------
3 // This code was generated by a tool.
4 // Runtime Version:2.0.50727.4927
6 // Changes to this file may cause incorrect behavior and will be lost if
7 // the code is regenerated.
9 //------------------------------------------------------------------------------
11 // Original file name:
12 // Generation date: 9/16/2009 8:05:44 PM
13 namespace CSADONETDataServiceSL3Client
.SchoolLinqToEntitiesService
17 /// There are no comments for SQLServer2005DBEntities in the schema.
19 public partial class SQLServer2005DBEntities
: global::System
.Data
.Services
.Client
.DataServiceContext
22 /// Initialize a new SQLServer2005DBEntities object.
24 public SQLServer2005DBEntities(global::System
.Uri serviceRoot
) :
27 this.ResolveName
= new global::System
.Func
<global::System
.Type
, string>(this.ResolveNameFromType
);
28 this.ResolveType
= new global::System
.Func
<string, global::System
.Type
>(this.ResolveTypeFromName
);
29 this.OnContextCreated();
31 partial void OnContextCreated();
33 /// Since the namespace configured for this service reference
34 /// in Visual Studio is different from the one indicated in the
35 /// server schema, use type-mappers to map between the two.
37 protected global::System
.Type
ResolveTypeFromName(string typeName
)
39 if (typeName
.StartsWith("SQLServer2005DBModel", global::System
.StringComparison
.Ordinal
))
41 return this.GetType().Assembly
.GetType(string.Concat("CSADONETDataServiceSL3Client.SchoolLinqToEntitiesService", typeName
.Substring(20)), true);
46 /// Since the namespace configured for this service reference
47 /// in Visual Studio is different from the one indicated in the
48 /// server schema, use type-mappers to map between the two.
50 protected string ResolveNameFromType(global::System
.Type clientType
)
52 if (clientType
.Namespace
.Equals("CSADONETDataServiceSL3Client.SchoolLinqToEntitiesService", global::System
.StringComparison
.Ordinal
))
54 return string.Concat("SQLServer2005DBModel.", clientType
.Name
);
59 /// There are no comments for Course in the schema.
61 public global::System
.Data
.Services
.Client
.DataServiceQuery
<Course
> Course
65 if ((this._Course
== null))
67 this._Course
= base.CreateQuery
<Course
>("Course");
72 private global::System
.Data
.Services
.Client
.DataServiceQuery
<Course
> _Course
;
74 /// There are no comments for CourseGrade in the schema.
76 public global::System
.Data
.Services
.Client
.DataServiceQuery
<CourseGrade
> CourseGrade
80 if ((this._CourseGrade
== null))
82 this._CourseGrade
= base.CreateQuery
<CourseGrade
>("CourseGrade");
84 return this._CourseGrade
;
87 private global::System
.Data
.Services
.Client
.DataServiceQuery
<CourseGrade
> _CourseGrade
;
89 /// There are no comments for Person in the schema.
91 public global::System
.Data
.Services
.Client
.DataServiceQuery
<Person
> Person
95 if ((this._Person
== null))
97 this._Person
= base.CreateQuery
<Person
>("Person");
102 private global::System
.Data
.Services
.Client
.DataServiceQuery
<Person
> _Person
;
104 /// There are no comments for Course in the schema.
106 public void AddToCourse(Course course
)
108 base.AddObject("Course", course
);
111 /// There are no comments for CourseGrade in the schema.
113 public void AddToCourseGrade(CourseGrade courseGrade
)
115 base.AddObject("CourseGrade", courseGrade
);
118 /// There are no comments for Person in the schema.
120 public void AddToPerson(Person person
)
122 base.AddObject("Person", person
);
126 /// There are no comments for SQLServer2005DBModel.Course in the schema.
131 [global::System
.Data
.Services
.Common
.DataServiceKeyAttribute("CourseID")]
132 public partial class Course
135 /// Create a new Course object.
137 /// <param name="courseID">Initial value of CourseID.</param>
138 /// <param name="title">Initial value of Title.</param>
139 /// <param name="credits">Initial value of Credits.</param>
140 /// <param name="departmentID">Initial value of DepartmentID.</param>
141 public static Course
CreateCourse(int courseID
, string title
, int credits
, int departmentID
)
143 Course course
= new Course();
144 course
.CourseID
= courseID
;
145 course
.Title
= title
;
146 course
.Credits
= credits
;
147 course
.DepartmentID
= departmentID
;
151 /// There are no comments for Property CourseID in the schema.
157 return this._CourseID
;
161 this.OnCourseIDChanging(value);
162 this._CourseID
= value;
163 this.OnCourseIDChanged();
166 private int _CourseID
;
167 partial void OnCourseIDChanging(int value);
168 partial void OnCourseIDChanged();
170 /// There are no comments for Property Title in the schema.
180 this.OnTitleChanging(value);
182 this.OnTitleChanged();
185 private string _Title
;
186 partial void OnTitleChanging(string value);
187 partial void OnTitleChanged();
189 /// There are no comments for Property Credits in the schema.
195 return this._Credits
;
199 this.OnCreditsChanging(value);
200 this._Credits
= value;
201 this.OnCreditsChanged();
204 private int _Credits
;
205 partial void OnCreditsChanging(int value);
206 partial void OnCreditsChanged();
208 /// There are no comments for Property DepartmentID in the schema.
210 public int DepartmentID
214 return this._DepartmentID
;
218 this.OnDepartmentIDChanging(value);
219 this._DepartmentID
= value;
220 this.OnDepartmentIDChanged();
223 private int _DepartmentID
;
224 partial void OnDepartmentIDChanging(int value);
225 partial void OnDepartmentIDChanged();
227 /// There are no comments for CourseGrade in the schema.
229 public global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
> CourseGrade
233 return this._CourseGrade
;
239 this._CourseGrade
= value;
243 private global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
> _CourseGrade
= new global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
>();
245 /// There are no comments for Person in the schema.
247 public global::System
.Collections
.ObjectModel
.Collection
<Person
> Person
257 this._Person
= value;
261 private global::System
.Collections
.ObjectModel
.Collection
<Person
> _Person
= new global::System
.Collections
.ObjectModel
.Collection
<Person
>();
264 /// There are no comments for SQLServer2005DBModel.CourseGrade in the schema.
269 [global::System
.Data
.Services
.Common
.DataServiceKeyAttribute("EnrollmentID")]
270 public partial class CourseGrade
273 /// Create a new CourseGrade object.
275 /// <param name="enrollmentID">Initial value of EnrollmentID.</param>
276 public static CourseGrade
CreateCourseGrade(int enrollmentID
)
278 CourseGrade courseGrade
= new CourseGrade();
279 courseGrade
.EnrollmentID
= enrollmentID
;
283 /// There are no comments for Property EnrollmentID in the schema.
285 public int EnrollmentID
289 return this._EnrollmentID
;
293 this.OnEnrollmentIDChanging(value);
294 this._EnrollmentID
= value;
295 this.OnEnrollmentIDChanged();
298 private int _EnrollmentID
;
299 partial void OnEnrollmentIDChanging(int value);
300 partial void OnEnrollmentIDChanged();
302 /// There are no comments for Property Grade in the schema.
304 public global::System
.Nullable
<decimal> Grade
312 this.OnGradeChanging(value);
314 this.OnGradeChanged();
317 private global::System
.Nullable
<decimal> _Grade
;
318 partial void OnGradeChanging(global::System
.Nullable
<decimal> value);
319 partial void OnGradeChanged();
321 /// There are no comments for Course in the schema.
331 this._Course
= value;
334 private Course _Course
;
336 /// There are no comments for Person in the schema.
346 this._Person
= value;
349 private Person _Person
;
352 /// There are no comments for SQLServer2005DBModel.Person in the schema.
357 [global::System
.Data
.Services
.Common
.DataServiceKeyAttribute("PersonID")]
358 public partial class Person
361 /// Create a new Person object.
363 /// <param name="personID">Initial value of PersonID.</param>
364 /// <param name="lastName">Initial value of LastName.</param>
365 /// <param name="firstName">Initial value of FirstName.</param>
366 /// <param name="personCategory">Initial value of PersonCategory.</param>
367 public static Person
CreatePerson(int personID
, string lastName
, string firstName
, short personCategory
)
369 Person person
= new Person();
370 person
.PersonID
= personID
;
371 person
.LastName
= lastName
;
372 person
.FirstName
= firstName
;
373 person
.PersonCategory
= personCategory
;
377 /// There are no comments for Property PersonID in the schema.
383 return this._PersonID
;
387 this.OnPersonIDChanging(value);
388 this._PersonID
= value;
389 this.OnPersonIDChanged();
392 private int _PersonID
;
393 partial void OnPersonIDChanging(int value);
394 partial void OnPersonIDChanged();
396 /// There are no comments for Property LastName in the schema.
398 public string LastName
402 return this._LastName
;
406 this.OnLastNameChanging(value);
407 this._LastName
= value;
408 this.OnLastNameChanged();
411 private string _LastName
;
412 partial void OnLastNameChanging(string value);
413 partial void OnLastNameChanged();
415 /// There are no comments for Property FirstName in the schema.
417 public string FirstName
421 return this._FirstName
;
425 this.OnFirstNameChanging(value);
426 this._FirstName
= value;
427 this.OnFirstNameChanged();
430 private string _FirstName
;
431 partial void OnFirstNameChanging(string value);
432 partial void OnFirstNameChanged();
434 /// There are no comments for Property PersonCategory in the schema.
436 public short PersonCategory
440 return this._PersonCategory
;
444 this.OnPersonCategoryChanging(value);
445 this._PersonCategory
= value;
446 this.OnPersonCategoryChanged();
449 private short _PersonCategory
;
450 partial void OnPersonCategoryChanging(short value);
451 partial void OnPersonCategoryChanged();
453 /// There are no comments for Property HireDate in the schema.
455 public global::System
.Nullable
<global::System
.DateTime
> HireDate
459 return this._HireDate
;
463 this.OnHireDateChanging(value);
464 this._HireDate
= value;
465 this.OnHireDateChanged();
468 private global::System
.Nullable
<global::System
.DateTime
> _HireDate
;
469 partial void OnHireDateChanging(global::System
.Nullable
<global::System
.DateTime
> value);
470 partial void OnHireDateChanged();
472 /// There are no comments for Property EnrollmentDate in the schema.
474 public global::System
.Nullable
<global::System
.DateTime
> EnrollmentDate
478 return this._EnrollmentDate
;
482 this.OnEnrollmentDateChanging(value);
483 this._EnrollmentDate
= value;
484 this.OnEnrollmentDateChanged();
487 private global::System
.Nullable
<global::System
.DateTime
> _EnrollmentDate
;
488 partial void OnEnrollmentDateChanging(global::System
.Nullable
<global::System
.DateTime
> value);
489 partial void OnEnrollmentDateChanged();
491 /// There are no comments for Property Picture in the schema.
493 public byte[] Picture
497 if ((this._Picture
!= null))
499 return ((byte[])(this._Picture
.Clone()));
508 this.OnPictureChanging(value);
509 this._Picture
= value;
510 this.OnPictureChanged();
513 private byte[] _Picture
;
514 partial void OnPictureChanging(byte[] value);
515 partial void OnPictureChanged();
517 /// There are no comments for CourseGrade in the schema.
519 public global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
> CourseGrade
523 return this._CourseGrade
;
529 this._CourseGrade
= value;
533 private global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
> _CourseGrade
= new global::System
.Collections
.ObjectModel
.Collection
<CourseGrade
>();
535 /// There are no comments for Course in the schema.
537 public global::System
.Collections
.ObjectModel
.Collection
<Course
> Course
547 this._Course
= value;
551 private global::System
.Collections
.ObjectModel
.Collection
<Course
> _Course
= new global::System
.Collections
.ObjectModel
.Collection
<Course
>();